package com.woniu.microworkorderserver.feign;

import com.woniu.microcommonsserver.param.ResponseMsg;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

import java.util.Map;

@Component
public class MicroAssetServerFallbackFactory implements FallbackFactory<AssetServerFeign> {
    @Override
    public AssetServerFeign create(Throwable throwable) {
        System.out.println("进入熔断");
        return new AssetServerFeign() {
            @Override
            public ResponseMsg findAssetAll() {
                return ResponseMsg.builder().code(200).msg("获取数据已达熔断").build();
            }
        };
    }
}
